<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	elementFormDefault="qualified"
	targetNamespace="http://www.simmack.de/2006/help2"
	xmlns="http://www.simmack.de/2006/help2"
>
	<xs:annotation><xs:documentation>
		Help 2.0 Registration Validation Schema
		Copyright (c) 2005 Mathias Simmack
	</xs:documentation></xs:annotation>

	<xs:element name="register">
		<xs:annotation><xs:documentation>
			This is the main node. You have to use this node! The node can include
			a namespace registration, a plug-in registration, or both. But it must
			not be empty.
		</xs:documentation></xs:annotation>
		<xs:complexType>
			<xs:sequence minOccurs="1" maxOccurs="unbounded">
				<xs:choice>
					<xs:element ref="namespace"/>
					<xs:element ref="plugin"/>
				</xs:choice>
			</xs:sequence>
  		</xs:complexType>
	</xs:element>

	<xs:element name="namespace">
		<xs:annotation><xs:documentation>
			This node is required to register Help 2.0 documents and filters. The
			node can include a Help document registration, a filter registration,
			or both. But it must not be empty.
		</xs:documentation></xs:annotation>
	  	<xs:complexType>
			<xs:sequence minOccurs="1" maxOccurs="unbounded">
				<xs:choice>
					<xs:element ref="file"/>
					<xs:element ref="filter"/>
					<xs:element name="plugin">
						<xs:annotation><xs:documentation>
							This is a special node to register plug-ins. But it
							just supports the child node (s. below).
						</xs:documentation></xs:annotation>
						<xs:complexType>
							<xs:sequence minOccurs="1" maxOccurs="unbounded">
								<xs:element ref="child"/>
							</xs:sequence>
						</xs:complexType>
					</xs:element>
				</xs:choice>
			</xs:sequence>
	  		<xs:attribute name="name" type="xs:string" use="required">
	  			<xs:annotation><xs:documentation>
	  				The internal Namespace name of the Help 2.0 collection. This
	  				attribute is required.
	  			</xs:documentation></xs:annotation>
	  		</xs:attribute>
	  		<xs:attribute name="description" type="xs:string" use="required">
	  			<xs:annotation><xs:documentation>
	  				The description of the Help 2.0 collection, you want to register.
	  				This attribute is required.
	  			</xs:documentation></xs:annotation>
	  		</xs:attribute>
	  		<xs:attribute name="file" use="required">
	  			<xs:annotation><xs:documentation>
	  				The collection file (*.HxC/*.HxS) of the Help 2.0 collection,
	  				you want to register. This attribute is required.
	  			</xs:documentation></xs:annotation>
	  			<xs:simpleType>
	  				<xs:restriction base="xs:string">
	  					<xs:pattern value=".+\.[Hh][Xx][CcSs]"/>
	  				</xs:restriction>
	  			</xs:simpleType>
	  		</xs:attribute>
	  		<xs:attribute name="merge" default="yes" type="YesNoType">
	  			<xs:annotation><xs:documentation>
	  				Set this attribute to "no" if you do not want to merge the collection
	  				after registering it. The default value is "yes". The attribute is
	  				optional.
	  			</xs:documentation></xs:annotation>
			</xs:attribute>
	  		<xs:attribute name="update" default="no" type="YesNoType">
	  			<xs:annotation><xs:documentation>
	  				Use this attribute if you want to add new files or filters to an
	  				existing Help 2.0 namespace. The default value is "no". It means,
	  				if the namespace does exist, it will be removed first and then it
	  				will be re-registered. If you do not want to remove the namespace,
	  				set the attribute to "yes". The attribute is optional.
	  			</xs:documentation></xs:annotation>
			</xs:attribute>
	  		<xs:attribute name="noremove" default="no" type="YesNoType">
	  			<xs:annotation><xs:documentation>
	  				Use this attribute if you want to remove files or filters without
	  				removing the whole namespace. The default value is "no". It means,
	  				if you are about to unregister, it will remove all files and filters,
	  				listed in your XML file, and then it will also remove the namespace.
	  				The attribute is optional.
	  			</xs:documentation></xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>

	<xs:element name="file">
		<xs:annotation><xs:documentation>
			This node is required to register a Help 2.0 document.
		</xs:documentation></xs:annotation>
	  	<xs:complexType>
	  		<xs:attribute name="Id" type="xs:string" use="required">
	  			<xs:annotation><xs:documentation>
	  				The Help 2.0 document's internal name. This name is required to
	  				identify the document. You can use the same name in different
	  				namespaces, but the name has to be unique in a single namespace.
	  				The attribute is required.
	  			</xs:documentation></xs:annotation>
	  		</xs:attribute>
	  		<xs:attribute name="LangId" type="LangIdType" use="required">
	  			<xs:annotation><xs:documentation>
	  				The document's language id. Typical values are 1033, 1031, ...
	  				The attribute is required.
	  			</xs:documentation></xs:annotation>
	  		</xs:attribute>
	  		<xs:attribute name="HxS" use="required">
	  			<xs:annotation><xs:documentation>
	  				This attribute is required because it is the main Help document
	  				(*.HxS). It's not possible to register a Help document without
	  				this file.
	  			</xs:documentation></xs:annotation>
	  			<xs:simpleType>
	  				<xs:restriction base="xs:string">
	  					<xs:pattern value=".+\.[Hh][Xx][Ss]"/>
	  				</xs:restriction>
	  			</xs:simpleType>
	  		</xs:attribute>
	  		<xs:attribute name="HxI">
	  			<xs:annotation><xs:documentation>
	  				This attribute is optional. You need it if your index is in a
	  				separate file (*.HxI).
	  			</xs:documentation></xs:annotation>
	  			<xs:simpleType>
	  				<xs:restriction base="xs:string">
	  					<xs:pattern value=".+\.[Hh][Xx][IiSs]"/>
	  				</xs:restriction>
	  			</xs:simpleType>
	  		</xs:attribute>
	  		<xs:attribute name="HxQ">
	  			<xs:annotation><xs:documentation>
	  				This attribute is optional. You just need it if you have a
	  				combined full-text search file (*.HxQ) installed with your
	  				Help 2.0 collection.
	  			</xs:documentation></xs:annotation>
	  			<xs:simpleType>
	  				<xs:restriction base="xs:string">
	  					<xs:pattern value=".+\.[Hh][Xx][Qq]"/>
	  				</xs:restriction>
	  			</xs:simpleType>
	  		</xs:attribute>
	  		<xs:attribute name="HxR">
	  			<xs:annotation><xs:documentation>
	  				This attribute is optional. You just need it if you have a combined
	  				attributes file (*.HxR) installed with your Help 2.0 collection.
	  			</xs:documentation></xs:annotation>
	  			<xs:simpleType>
	  				<xs:restriction base="xs:string">
	  					<xs:pattern value=".+\.[Hh][Xx][Rr]"/>
	  				</xs:restriction>
	  			</xs:simpleType>
	  		</xs:attribute>
	  		<xs:attribute name="HxSMediaId" type="xs:string">
	  			<xs:annotation><xs:documentation>
	  				Because the Help 2.0 API is not documented, there is no real
	  				explanation of this attribute. Sorry. My guess is that this
	  				attribute specifies the ID of the disk medium (CD, Floppy, or
	  				whatever) if the file is on a removable medium. So, if you try
	  				to open the document, the viewer asks for the valid medium and
	  				checks its ID with this given value.
	  			</xs:documentation></xs:annotation>
	  		</xs:attribute>
	  		<xs:attribute name="HxQMediaId" type="xs:string">
	  			<xs:annotation><xs:documentation>
	  				Because the Help 2.0 API is not documented, there is no real
	  				explanation of this attribute. Sorry. My guess is that this
	  				attribute specifies the ID of the disk medium (CD, Floppy, or
	  				whatever) if the file is on a removable medium. So, if you try
	  				to open the document, the viewer asks for the valid medium and
	  				checks its ID with this given value.
	  			</xs:documentation></xs:annotation>
	  		</xs:attribute>
	  		<xs:attribute name="HxRMediaId" type="xs:string">
	  			<xs:annotation><xs:documentation>
	  				Because the Help 2.0 API is not documented, there is no real
	  				explanation of this attribute. Sorry. My guess is that this
	  				attribute specifies the ID of the disk medium (CD, Floppy, or
	  				whatever) if the file is on a removable medium. So, if you try
	  				to open the document, the viewer asks for the valid medium and
	  				checks its ID with this given value.
	  			</xs:documentation></xs:annotation>
	  		</xs:attribute>
	  		<xs:attribute name="SampleMediaId" type="xs:string">
	  			<xs:annotation><xs:documentation>
	  				Because the Help 2.0 API is not documented, there is no real
	  				explanation of this attribute. Sorry. My guess is that this
	  				attribute specifies the ID of the disk medium (CD, Floppy, or
	  				whatever) if the file is on a removable medium. So, if you try
	  				to open the document, the viewer asks for the valid medium and
	  				checks its ID with this given value.
	  			</xs:documentation></xs:annotation>
	  		</xs:attribute>
		</xs:complexType>
	</xs:element>

	<xs:element name="filter">
		<xs:annotation><xs:documentation>
			This node is required to register a filter.
		</xs:documentation></xs:annotation>
	  	<xs:complexType>
	  		<xs:simpleContent>
				<xs:annotation><xs:documentation>
					The content of this node is the filter query string. Please use
					a CDATA block. If there is no content, an empty filter will be
					created.
				</xs:documentation></xs:annotation>
	  			<xs:extension base="xs:string">
	  				<xs:attribute name="name" type="xs:string" use="required">
	  					<xs:annotation><xs:documentation>
	  						This attribute specifies the filter name, you will see
	  						in the viewer's combobox. Use a descriptive name here.
	  						The attribute is required.
	  					</xs:documentation></xs:annotation>
	  				</xs:attribute>
	  			</xs:extension>
	  		</xs:simpleContent>
		</xs:complexType>
	</xs:element>

	<xs:element name="plugin">
		<xs:annotation><xs:documentation>
			This node is required to register a Help 2.0 plug-in. A plug-in
			connects two different Help 2.0 namespaces together. But you can
			connect real collections (registered *.HxC files) only!
		</xs:documentation></xs:annotation>
	  	<xs:complexType>
	  		<xs:sequence minOccurs="0" maxOccurs="unbounded">
	  			<xs:element ref="child"/>
	  		</xs:sequence>
			<xs:attribute name="parent" type="xs:string" use="required">
	  			<xs:annotation><xs:documentation>
	  				This attribute specifies the parent namespace. The attribute
	  				is required. The namespace must exist, of course.
	  			</xs:documentation></xs:annotation>
  			</xs:attribute>
			<xs:attribute name="child" type="xs:string">
	  			<xs:annotation><xs:documentation>
	  				This attribute specifies the child namespace. The attribute
	  				is required. The namespace must exist, of course.
	  			</xs:documentation></xs:annotation>
  			</xs:attribute>
	  		<xs:attribute name="merge" default="yes" type="YesNoType">
	  			<xs:annotation><xs:documentation>
	  				Set this attribute to "no" if you do not want to merge the collection
	  				after registering it. The default value is "yes". The attribute is
	  				optional.
	  			</xs:documentation></xs:annotation>
			</xs:attribute>
	  	</xs:complexType>
	</xs:element>

	<xs:element name="child">
		<xs:annotation><xs:documentation>
			This node specifies a lower plug-in node. It's useful if you want to
			register more than one plug-in for the same namespace. You can reduce
			the time to merge the namespace using this way.
		</xs:documentation></xs:annotation>
	  	<xs:complexType>
	  		<xs:attribute name="name" type="xs:string" use="required">
	  			<xs:annotation><xs:documentation></xs:documentation></xs:annotation>
	  		</xs:attribute>
		</xs:complexType>
	</xs:element>

	<xs:simpleType name="LangIdType">
		<xs:annotation><xs:documentation>
			Values of this type are languages identifiers.
		</xs:documentation></xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="[0-9]{4}"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="YesNoType">
		<xs:annotation><xs:documentation>
			Values of this type will either be "yes" or "no".
		</xs:documentation></xs:annotation>
		<xs:restriction base='xs:NMTOKEN'>
			<xs:enumeration value="no"/>
			<xs:enumeration value="yes"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>